<?php
/**
 * JBLOG入口程序 - JBlog
 * 
 * @copyright (c) 2008-2010 JBlog (www.lisijie.org)
 * @author lisijie <lisijie86@gmail.com>
 * @version $Id: index.php 445 2010-05-26 07:54:51Z lisijie86 $
*/

require 'include/common.php';

$get = $rewrite->parse();
//var_dump($get);die;
if ( cache_page() ) {
	require_once JBLOG_INC.'class_cachepage.php';
	$page_cache = new CachePage();
	$content = $page_cache->get($get);
	if ( $content ) {
		echo $content;
		die;
	}
}

if ( is_file(THEME_ROOT.'function.php') ) {
	include_once(THEME_ROOT.'function.php');
}

require JBLOG_INC.'func_post.php';
require JBLOG_INC.'func_comment.php';
require JBLOG_INC.'func_template.php';

if ( preg_match('/^[a-z]+$/', $get['mod']) && is_file(JBLOG_ROOT.'module'.DS.$get['mod'].'.php') ) {
	define('MOD', $get['mod']);
	require_once(JBLOG_ROOT.'module'.DS.$get['mod'].'.php');
} else {
	error_404();
}

footer();
?>